/*  This file is part of the comicconquer project
    Copyright (C) 2010 Reach <reach334@gmail.com>

    ComicConquer is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This software is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public 
    License along with this software.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef COLISTDLG_H
#define COLISTDLG_H

#include "mist.h"
#include "onyx/ui/onyx_dialog.h"
#include "CoListWidget.h"

class CoListDlg : public ui::OnyxDialog
{
    Q_OBJECT

    //-- constructor
public:
    CoListDlg(CoListItems* items, QWidget* parent = 0);

    //-- public methods
public:
    CoListItem* popup();
    void refreshScreen(ScreenProxy::Waveform w = ScreenProxy::GU, bool whole = false);
    static CoListItem* select(CoListItems* items, QWidget* parent = 0);

    //-- private slots
private slots:
    void selectedItem(const QModelIndex& index);
    bool event(QEvent* e);
    void keyReleaseEvent(QKeyEvent* event);

    //-- private members
private:
    CoListWidget* m_list;
    int m_selectId;

};

#endif // COLISTWIDGET_H
